import request from '@/utils/request'

// 查询岗位列表
export function listProcess(query) {
  return request({
    url: '/system/process/list',
    method: 'get',
    params: query
  })
}

export function getList1(query) {
  return request({
    url: '/system/process/getList1',
    method: 'get',
    params: query
  })
}

export function getList2(query) {
  return request({
    url: '/system/process/getList2',
    method: 'get',
    params: query
  })
}


// 查询岗位详细
export function getProcess(routeId) {
  return request({
    url: '/system/process/' + routeId,
    method: 'get'
  })
}
export function getRouteProcess(recordId) {
  return request({
    url: '/system/process/routeProcess/' + recordId,
    method: 'get'
  })
}
export function getRouteProduct(recordId) {
  return request({
    url: '/system/process/routeProduct/' + recordId,
    method: 'get'
  })
}
//查询物料产品分类
export function getMdItemTypeTreeList() {
  return request({
    url: '/system/process/getMdItemTypeTreeList/',
    method: 'get'
  })
}
//通过id查询物料产品
export function getMdItemByIdList(query) {
  return request({
    url: '/system/process/getMdItemByIdList',
    method: 'get',
    params: query,
  })
}
//查询物料产品
export function getMdItemList(query) {
  return request({
    url: '/system/process/getMdItemList',
    method: 'get',
    params: query
  })
}

// 新增岗位
export function addProcess(data) {
  return request({
    url: '/system/process',
    method: 'post',
    data: data
  })
}
export function addRouteProcess(data) {
  return request({
    url: '/system/process/routeprocess',
    method: 'post',
    data: data
  })
}
export function addRouteProduct(data) {
  return request({
    url: '/system/process/addRouteProduct',
    method: 'post',
    data: data
  })
}

// 修改岗位
export function updateProcess(data) {
  return request({
    url: '/system/process',
    method: 'put',
    data: data
  })
}
export function updateRouteProcess(data) {
  return request({
    url: '/system/process/routeprocess',
    method: 'put',
    data: data
  })
}
export function updateRouteProduct(data) {
  return request({
    url: '/system/process/routeproduct',
    method: 'put',
    data: data
  })
}

// 删除岗位
export function delProcess(routeId) {
  return request({
    url: '/system/process/' + routeId,
    method: 'delete'
  })
}
export function delRouteProcess(recordId) {
  return request({
    url: '/system/process/routeProcess/' + recordId,
    method: 'delete'
  })
}
export function delRouteProduct(recordId) {
  return request({
    url: '/system/process/routeProduct/' + recordId,
    method: 'delete'
  })
}
